const express=require('express');
const bodyParser=require('body-parser');
const server=express();
const port=9000;

/*server.all('/api/*',(req,res,next)=>{
	console.log(req.method,req.url,new Date());
	next();
});
*/
server.use('/api/banners',require('./router/banners'));

server.use('/api/authservice',bodyParser(),require('./router/authservice'));

server.use('/api/user',bodyParser(),require('./router/user'));

//404
server.use((req, res)=>{
    res.status(404);
});

//500
server.use((err,req, res)=>{
    console.log('Server Error:',err);
    res.status(500);
});


server.listen(port,()=>{
    console.log(`Vue-webpack-RESTful@${port}--${new Date().toLocaleString()}`);
});
